/*
package com.travel.service.message;

import com.mongodb.client.result.DeleteResult;
import com.travel.common.ServerResponse;
import com.travel.dao.message.MessageDAO;
import com.travel.pojo.message.Message;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MessageServer {
    @Autowired
    MessageDAO messageDAO;

    */
/**
     * 群聊消息状态码更改
     * @param tid 房间号
     * @param page 分页从第几个开始
     * @param rows 分页查询数量
     * @param msgType 消息类型，区分是普通群消息还是公告
     *//*

    public List<Message> queryMessage(int tid,int msgType,Integer page,Integer rows){
        List<Message> list=this.messageDAO.findListByFromAndTo(tid, msgType,page, rows);
        //会查到page条消息，遍历将查到的消息的状态码改为已读
        for (Message message:list){
            if (message.getStatus().intValue()==1){
                this.messageDAO.updateMessageState(message.getId(),2);
            }
        }
        return list;

    }

    */
/**
     *多聊天消息删除
     * mongodb删除成功会返回结果DeletedCount=1
     * @param objectId 消息的唯一标识
     *//*

    public ServerResponse<String> deleteMessage(ObjectId objectId){
        DeleteResult deleteResult=messageDAO.deleteMessage(objectId);
        if (deleteResult.getDeletedCount()==1){
            return ServerResponse.createBySuccseeMessage("删除成功");
        }else {
            return ServerResponse.createByErrorMessage("删除失败");
        }
    }

}
*/
